package com.tmsb.bigscreen.config;

import com.tmsb.bigscreen.utils.RedisCluster;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.JedisCluster;

/**
 *Description:
 *Version:1.0.0
 *@author shihb
 *@date 2020/7/1 18:52
 */
@Configuration
public class RedisConfig {
  @Value("${spring.redis.cluster.nodes}")
  private String clusterNodes;
  @Bean(name = "JedisCluster")
  public JedisCluster getRedisCluster() {
    return RedisCluster.getInstance(clusterNodes).getRedisClusterList().get(0);
  }
}
